Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-13450] Admin: Display Multi-organization Enterprise attributes on provider details #4955

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

jonashendrickx
Copy link
Member

@jonashendrickx jonashendrickx commented Oct 29, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13450

📔 Objective

Allow editing multi-organization enterprises in the 'Admin' application.

Allow changing properties:

  • Plan (interval)
  • Minimum Seats

If both configuration values are changed at the same time the changes happen in the following order:

  1. Process the plan change and copy over any existing values.
  2. Update the seat minimum.

By making updates to providers or provider plans more atomical, we'd be able to re-use any existing code for other new types of providers as well as reduce the code complexity.

📸 Screenshots

Scenario 1: Changing from Annual & 19 min seats to Monthly & 21 min seats:

image image

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 48.58757% with 91 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@6cc097e). Learn more about missing BASE report.
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/Admin/AdminConsole/Models/ProviderEditModel.cs 0.00% 29 Missing ⚠️
...in/AdminConsole/Controllers/ProvidersController.cs 0.00% 25 Missing ⚠️
src/Admin/AdminConsole/Views/Providers/Edit.cshtml 0.00% 13 Missing ⚠️
.../Commercial.Core/Billing/ProviderBillingService.cs 89.53% 5 Missing and 4 partials ⚠️
...ation/Services/Implementations/ProviderMigrator.cs 0.00% 8 Missing ⚠️
src/Core/Services/Implementations/StripeAdapter.cs 0.00% 7 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4955   +/-   ##
=======================================
  Coverage        ?   42.55%           
=======================================
  Files           ?     1389           
  Lines           ?    64717           
  Branches        ?     5938           
=======================================
  Hits            ?    27539           
  Misses          ?    35959           
  Partials        ?     1219           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonashendrickx jonashendrickx marked this pull request as ready for review October 29, 2024 12:58
@jonashendrickx jonashendrickx requested review from a team as code owners October 29, 2024 12:58
…anization-Enterprise-attributes-on-provider-details' into PM-13450-Admin-Display-Multi-organization-Enterprise-attributes-on-provider-details
…anization-Enterprise-attributes-on-provider-details' into PM-13450-Admin-Display-Multi-organization-Enterprise-attributes-on-provider-details
Copy link
Contributor

@amorask-bitwarden amorask-bitwarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love where this is headed, just a few questions.

Provider provider,
int enterpriseSeatMinimum,
int teamsSeatMinimum)
public async Task ChangePlan(ChangeProviderPlanCommand command)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Looks like this is called in one place where we already have access to both the Provider and the ProviderPlan. Could we just include those in the command rather than double fetch them from the DB?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have to check if I can refactor the duplicate call to retrieve provider plans further at this point


var teamsProviderPlan =
providerPlans.Single(providerPlan => providerPlan.PlanType == PlanType.TeamsMonthly);
public async Task UpdateSeatMinimums(UpdateProviderSeatMinimumsCommand command)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Same question as above with regard to this command.

src/Admin/AdminConsole/Controllers/ProvidersController.cs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants